package edu.manchester.biology.eqhei.testing;


import edu.manchester.biology.eqhei.implementations.eQHEI_AttributeIMP;
import edu.manchester.biology.eqhei.implementations.eQHEI_AttributeSetIMP;
import edu.manchester.biology.eqhei.interfaces.eQHEI_Attribute;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author mekendall
 */
public class MainTestingAttributeSet {
    public static void main(String[] args) throws Exception{
        eQHEI_AttributeSetIMP eq = new eQHEI_AttributeSetIMP();      
        String nameBase = "name";
        for(int i = 0; i < 10; i++){
            eQHEI_Attribute a = new eQHEI_AttributeIMP(nameBase+Integer.toString(i), i);
            eq.add(a);
        }
        try{
           while(true){
            eQHEI_Attribute a = eq.next();
            System.out.println(a.getName() + " " + a.getValue());
            } 
        }
        catch(Exception e){
            System.out.println(e.getMessage());
        }
        
        try{
           while(true){
            eQHEI_Attribute a = eq.previous();
            System.out.println(a.getName() + " " + a.getValue());
            } 
        }
        catch(Exception e){
            System.out.println(e.getMessage());
        }
        
         try{
           while(true){
            eQHEI_Attribute a = eq.next();
            System.out.println(a.getName() + " " + a.getValue());
            } 
        }
        catch(Exception e){
            System.out.println(e.getMessage());
        }
         
         for(int i = 0; i < eq.length(); i++){
            eQHEI_Attribute a = eq.get(nameBase+Integer.toString(i));
            System.out.println(a.getName() + " " + a.getValue());
         }
         
         for(int i = eq.length()-1; i >= 0; i--){
            eQHEI_Attribute a = eq.get(i);
            System.out.println(a.getName() + " " + a.getValue());
         }
    }
}
